﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:tagging="clr-namespace:NASA.BeAMartian"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
	xmlns:System="clr-namespace:System;assembly=mscorlib" 
    x:Class="NASA.BeAMartian.Views.Participate.RoverTagging"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False">
	<phone:PhoneApplicationPage.Resources>
		<Style x:Key="ListBoxStyle1" TargetType="ListBox">
			<Setter Property="Padding" Value="1"/>
			<Setter Property="Background" Value="#FFFFFFFF"/>
			<Setter Property="Foreground" Value="#FF000000"/>
			<Setter Property="HorizontalContentAlignment" Value="Left"/>
			<Setter Property="VerticalContentAlignment" Value="Top"/>
			<Setter Property="IsTabStop" Value="False"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="TabNavigation" Value="Once"/>
			<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
			<Setter Property="BorderBrush">
				<Setter.Value>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<GradientStop Color="#FFA3AEB9" Offset="0"/>
						<GradientStop Color="#FF8399A9" Offset="0.375"/>
						<GradientStop Color="#FF718597" Offset="0.375"/>
						<GradientStop Color="#FF617584" Offset="1"/>
					</LinearGradientBrush>
				</Setter.Value>
			</Setter>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="ListBox">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="ValidationStates">
									<VisualState x:Name="Valid"/>
									<VisualState x:Name="InvalidUnfocused">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="InvalidFocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" CornerRadius="2">
								<ScrollViewer x:Name="ScrollViewer" Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="0" Padding="{TemplateBinding Padding}" TabNavigation="{TemplateBinding TabNavigation}">
									<ItemsPresenter HorizontalAlignment="Center"/>
								</ScrollViewer>
							</Border>
							<Border x:Name="ValidationErrorElement" Visibility="Collapsed" BorderBrush="#FFDB000C" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
								<Grid Height="10" HorizontalAlignment="Right" Margin="0,-4,-4,0" VerticalAlignment="Top" Width="10" Background="Transparent">
									<Path Fill="#FFDC000C" Margin="-1,3,0,0" Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"/>
									<Path Fill="#ffffff" Margin="-1,3,0,0" Data="M 0,0 L2,0 L 8,6 L8,8"/>
								</Grid>
							</Border>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ListBoxItemStyle1" TargetType="ListBoxItem">
			<Setter Property="Padding" Value="3"/>
			<Setter Property="HorizontalContentAlignment" Value="Left"/>
			<Setter Property="VerticalContentAlignment" Value="Top"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="TabNavigation" Value="Local"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="ListBoxItem">
						<Grid Background="{TemplateBinding Background}" Margin="0,3">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="SelectionStates">
									<VisualState x:Name="Unselected"/>
									<VisualState x:Name="Selected"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
									<VisualState x:Name="Unfocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<!--<Rectangle x:Name="fillColor" Fill="#FFBADDE9" RadiusX="1" RadiusY="1" IsHitTestVisible="False" Opacity="0"/>-->
							<!--<Rectangle x:Name="fillColor2" Fill="#FFBADDE9" RadiusX="1" RadiusY="1" IsHitTestVisible="False" Opacity="0"/>-->
							<ContentPresenter x:Name="contentPresenter" 
							HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
							Margin="2" Content="{TemplateBinding Content}" 
							ContentTemplate="{TemplateBinding ContentTemplate}"/>
							<!--<Rectangle x:Name="FocusVisualElement" Stroke="#FF6DBDD1" StrokeThickness="1" RadiusX="1" RadiusY="1" Visibility="Collapsed"/>-->
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Storyboard x:Name="sbOpenImage">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="tbLoadingTiles">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0">
					<EasingDoubleKeyFrame.EasingFunction>
						<BounceEase EasingMode="EaseInOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="imgRoverPicture">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1">
					<EasingDoubleKeyFrame.EasingFunction>
						<BounceEase EasingMode="EaseInOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="cnvLabel">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1">
					<EasingDoubleKeyFrame.EasingFunction>
						<BounceEase EasingMode="EaseInOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="sbOpenCategories">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="categoryButtonLand">
				<EasingDoubleKeyFrame KeyTime="0" Value="-4"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="141">
					<EasingDoubleKeyFrame.EasingFunction>
						<ElasticEase EasingMode="EaseOut" Oscillations="1" Springiness="1"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="categoryButtonSky">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="141">
					<EasingDoubleKeyFrame.EasingFunction>
						<ElasticEase EasingMode="EaseInOut" Oscillations="1" Springiness="1"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="categoryButtonRover">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="141">
					<EasingDoubleKeyFrame.EasingFunction>
						<ElasticEase EasingMode="EaseIn" Oscillations="1" Springiness="1"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="sbRoverTagsOpen">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="lbTagsRover">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BounceEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="TitlePanel">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="475.943">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="sbSkyTagsOpen">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="lbTagsSky">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BounceEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="TitlePanel">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="475.943">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="sbLandTagsOpen">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="lbTagsLand">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BounceEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="TitlePanel">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="475.943">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="sbCloseCategoryLand">
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="categoryButtonLand">
        		<SplineDoubleKeyFrame KeyTime="0" Value="141"/>
        		<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="-4"/>
        	</DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="sbCloseCategoryRover">
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="categoryButtonRover">
        		<SplineDoubleKeyFrame KeyTime="0" Value="141"/>
        		<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
        	</DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="sbCloseCategorySky">
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="categoryButtonSky">
        		<SplineDoubleKeyFrame KeyTime="0" Value="141"/>
        		<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
        	</DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </phone:PhoneApplicationPage.Resources>

	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>

    <!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Canvas.ZIndex="20000" x:Name="TitlePanel" Grid.Row="1" Margin="12,0,0,0" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment">
        	<StackPanel.RenderTransform>
        		<CompositeTransform/>
        	</StackPanel.RenderTransform>
            <TextBlock x:Name="LocationText" Text="TAP ALL THE FEATURES YOU SEE:" Style="{StaticResource PhoneTextTitle3Style}" FontSize="21.333" Margin="0,5,0,0" />
			<StackPanel Orientation="Horizontal" Margin="-4,8,0,0">
				<tagging:CategoryButtonLand Canvas.ZIndex="20000" Tag="Land" x:Name="categoryButtonLand" Width="151" Height="57" HorizontalAlignment="Left" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5">
            	<tagging:CategoryButtonLand.RenderTransform>
            		<CompositeTransform/>
            	</tagging:CategoryButtonLand.RenderTransform>
            </tagging:CategoryButtonLand>
                <tagging:CategoryButtonSky Canvas.ZIndex="20000" Tag="Sky" x:Name="categoryButtonSky" Width="131" Height="57" HorizontalAlignment="Left"  VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Margin="10,0,0,0">
            	<tagging:CategoryButtonSky.RenderTransform>
            		<CompositeTransform/>
            	</tagging:CategoryButtonSky.RenderTransform>

            </tagging:CategoryButtonSky>
                <tagging:CategoryButtonRover Canvas.ZIndex="20000" Tag="Rover" x:Name="categoryButtonRover" Width="161" HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.5" Height="57" VerticalAlignment="Top" Margin="10,0,0,0">
            	<tagging:CategoryButtonRover.RenderTransform>
            		<CompositeTransform/>
            	</tagging:CategoryButtonRover.RenderTransform>
            </tagging:CategoryButtonRover>
			</StackPanel>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentGrid" Grid.Row="1">
        	<Image Margin="-7,89,0,0" x:Name="imgRoverPicture" 
        		HorizontalAlignment="Left" VerticalAlignment="Top" Opacity="0" Width="512" Height="504" Stretch="UniformToFill" RenderTransformOrigin="0.5,0.5">
        		<Image.RenderTransform>
        			<CompositeTransform ScaleX="0.94" ScaleY="0.94"/>
        		</Image.RenderTransform>
        	</Image>
        	<Canvas x:Name="cnvImage" Margin="-235,39,-201,177" Height="480" 
                    RenderTransformOrigin="0.5,0.5"
                    ManipulationStarted="cnvImage_ManipulationStarted" >
        		<Canvas.RenderTransform>
        			<CompositeTransform ScaleX="1.3" ScaleY="1.3"/>
        		</Canvas.RenderTransform>
        	</Canvas>
        	<ProgressBar x:Name="pbLoadingBar" Height="37" Margin="-13,177,-15,0" VerticalAlignment="Top" IsIndeterminate="True" IsHitTestVisible="False" Foreground="#FF4BFF3C"/>
        	<TextBlock x:Name="tbLoadingTiles" Height="42" Margin="121,202,109,0" TextWrapping="Wrap" Text="loading rover image" VerticalAlignment="Top" FontSize="26.667" FontFamily="Segoe WP Light" IsHitTestVisible="False" d:LayoutOverrides="HorizontalAlignment" Foreground="#FF4BFF3C"/> 

			        			<Canvas x:Name="cnvLabel" Height="120" Margin="7,0,0,76" VerticalAlignment="Bottom" Opacity="0">
			        				<TextBlock x:Name="tbRover_Copy" Height="47" TextWrapping="Wrap" Text="Image 1 of 3" Canvas.Left="1" Width="318" FontSize="29.333" Canvas.Top="-23" FontFamily="Segoe WP Black"/>
			        				<TextBlock Height="29" TextWrapping="Wrap" Text="Picture Taken By:" Width="184" Canvas.Top="26" FontSize="24" Foreground="#FF4BFF3C"/>
			        				<TextBlock x:Name="tbRover" Height="29" TextWrapping="Wrap" Text="Opportunity" Canvas.Left="184" Width="289" FontSize="24" Canvas.Top="27"/>
			        				<TextBlock Height="29" TextWrapping="Wrap" Text="Camera:" Width="93" Canvas.Left="1" Canvas.Top="57" FontSize="24" Foreground="#FF4BFF3C"/>
			        				<TextBlock x:Name="tbCamera" Height="29" TextWrapping="Wrap" Text="Camera:" Width="378" Canvas.Left="95" Canvas.Top="57" FontSize="24"/>
			        				<TextBlock Height="29" TextWrapping="Wrap" Text="Site:" Width="48" Canvas.Left="2" Canvas.Top="88" FontSize="24" Foreground="#FF4BFF3C"/>
			        				<TextBlock x:Name="tbSite" Height="29" TextWrapping="Wrap" Text="Site:" Width="153" Canvas.Left="51" Canvas.Top="88" FontSize="24"/>
			        				<TextBlock Height="29" TextWrapping="Wrap" Text="Sol (Martian Day):" Width="192" Canvas.Top="88" Canvas.Left="179" FontSize="24" Foreground="#FF4BFF3C"/>
			        				<TextBlock x:Name="tbSol" Height="29" TextWrapping="Wrap" Text="1" Width="93" Foreground="White" Canvas.Left="378" Canvas.Top="89" FontSize="24"/>
			        			</Canvas>
        </Grid>
        <Button Click="Button_Click" Content="done - save tags" Height="81" Margin="-7,0,0,-4" Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="241"/>
        <Button Click="Button_Click_1" Content="pass - no features" Height="81" Margin="232,0,-6,-4" Grid.Row="1" VerticalAlignment="Bottom"/>
    </Grid>
<!--
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton Click="ApplicationBarIconButton_Click" IconUri="/icons/appbar.check.rest.png" Text="Done"/>
            <shell:ApplicationBarIconButton Click="ApplicationBarIconButton_Click_1" IconUri="/icons/appbar.cancel.rest.png" Text="Pass"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="done (save my tags)"/>
                <shell:ApplicationBarMenuItem Text="pass (unable to identify)"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
-->
</phone:PhoneApplicationPage>
